
####################################################
# Replication files for: Peer Conformity and Competition Shapes How Business 
# Managers Evaluate Withdrawals from Russia amidst the Ukraine Crisis
####################################################

# The folder contains the following files:
1. analysis.r: R script to replicate the main analysis in the paper.
2. appendix_fig.r: R script to replicate the figures in the appendix.
3. appendix_table.r: R script to replicate the tables in the appendix.
4. help.r: R script to load the necessary packages and functions.
5. u_sample.rds: R data file containing the data used in the analysis.

# To replicate the analysis, please run the following scripts in the order below:
1. help.r
2. analysis.r
3. appendix_fig.r
4. appendix_table.r

# R version
The analysis was conducted using the R software. The version of R used in the analysis is 4.1.2. The output of the `sessionInfo()` command is as follows:

R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] Zelig_5.1.7        survival_3.4-0     ZeligChoice_0.9-6  ggridges_0.5.4    
 [5] wfe_1.9.1          viridis_0.6.2      viridisLite_0.4.2  mediation_4.5.0   
 [9] mvtnorm_1.1-3      Matrix_1.5-1       MASS_7.3-58.1      Amelia_1.8.1      
[13] Rcpp_1.0.10        lmtest_0.9-40      zoo_1.8-12         sandwich_3.0-2    
[17] patchwork_1.1.2    hrbrthemes_0.8.0   broom_1.0.1        lubridate_1.9.2   
[21] wesanderson_0.3.6  estimatr_1.0.0     kableExtra_1.3.4   modelsummary_1.1.0
[25] stargazer_5.2.3    xlsx_0.6.5         readxl_1.4.1       forcats_1.0.0     
[29] stringr_1.5.0      dplyr_1.1.2        purrr_1.0.1        readr_2.1.4       
[33] tidyr_1.3.0        tibble_3.2.1       ggplot2_3.4.2      tidyverse_1.3.2   
[37] furrr_0.3.1        future_1.33.0     


# Data
The data used in the analysis is stored in the file `u_sample.rds`. The data is the anonymized version of the original survey data used for analysis. 
